<?php
/**
 * Created by PhpStorm.
 * User: ship
 * Date: 2024/12/26
 * Time: 12:58
 */

namespace ShipSun\LaravelSignature;


use Illuminate\Support\Manager;

class Signature extends Manager
{
    public function createHmacShaDriver()
    {
        if (property_exists($this, 'app')) {
            $config = $this->app->make('config');
        }
        if (property_exists($this, 'container')) {
            $config = $this->config;
        }
        $config = $config->get('signature.hmac_sha');
        $algo = $config['algo'] ?? "";
        $password = $config['password'] ?? "";
        return new HmacSha($algo, $password);
    }

    /**
     * Get the default driver name.
     *
     * @return string
     */
    public function getDefaultDriver()
    {
        return 'hmacSha';
    }
}